package org.alanlau.consumer;

import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

/**
 * 广播交换机消费者
 *
 * @author alan
 * @version 1.0
 * @date 2021/4/8 18:03
 */
@Component
public class FanoutCustomer {
    @RabbitListener(queues = "boot.fanoutQueue1")
    public void receive1(String message) {
        System.out.println("消费者【1】接收到消息：" + message);
    }

    @RabbitListener(queues = "boot.fanoutQueue2")
    public void receive2(String message) {
        System.out.println("消费者【2】接收到消息：" + message);
    }
}
